package com.itheima.innerclass.匿名内部类;

public class Demo {
    public static void main(String[] args) {
        useJump(new Jump() {

            @Override
            public void jump() {
                System.out.println("跳高");
            }

            @Override
            public void method() {
                System.out.println("方法执行");
            }
        });
        useJump(new Jump() {

            @Override
            public void jump() {
                System.out.println("跳高");
            }

            @Override
            public void method() {
                System.out.println("方法执行");
            }
        });
    }

    public static void useJump(Jump j) {
        j.jump();
        j.method();
    }
}

interface Jump {
    void jump();
    void method();
}